// pages/mine/balance/status/index.js
const other = require('../../../../service/other')
Page({

    /**
     * 页面的初始数据
     */
    data: {
        status: 0,
        dataList : [],
        param: {
            withdrawalapplication: {
                appStatus: 0,//0未审批，1已同意，2已拒绝
                customerId: 130,
            },
            queryRequest: {
                pageNum: 1,
                pageSize: 20
            }

        }
    },
    handleTabTap(e) {
        let status = e.currentTarget.dataset.status
        this.setData({
            status: status,
            ['param.withdrawalapplication.appStatus']: status,
        })
        this.initData()
    },
    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
        this.setData({
            ['param.withdrawalapplication.customerId']: wx.getStorageSync("userInfo").id,
        })
        this.initData()
    },

    initData() {
        this.setData({dataList : []})
        let param = this.data.param
        other.getWithdraw(param, (res) => {
            let dataList = res.data.records || []
            this.setData({ dataList : dataList })
        })
    },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {

    }
})